﻿using EntityModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;

namespace API.Controllers
{
    /// <summary>
    /// 镇辖区登记人员信息控制器
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class PeopleController : ControllerBase
    {
        private readonly APIDbContext db;

        public PeopleController(APIDbContext context)
        {
            db = context;
        }

        [HttpGet]
        public List<People> GetAllPeople()
        {
            return db.people.ToList();
        }

        [HttpGet("{lable_empty}")]
        public List<People> Get(bool lable_empty)
        {

            People?  people = db.people.Where(w => w.lable_empty == true).FirstOrDefault<People>();
            return db.people.ToList();
        }

    }
}
